﻿#ifndef SCAADISPATCHER_H
#define SCAADISPATCHER_H

#include "VisionManager/visionmanager.h"
#include "Laser/htg1laser.h"
#include "mastermotionmanager.h"
#include "systemCore/dispatcher.h"
#include "uphhelper.h"

#include <QObject>
#include <QQmlApplicationEngine>
#include <QQmlContext>

#include "Workers/AACore/aaimage.h"
#include "Workers/AACore/aacore.h"
#include "Workers/PickArm/pickarm.h"
#include "Workers/AAHead/aahead.h"
#include "Tray/lenstraymap.h"
#include "Tray/sensortraymap.h"
#include "../WorkerRepos/PressureMonitor/pressuremonitor.h"

class SCAADispatcher : public Dispatcher
{
        Q_OBJECT
public:
    explicit SCAADispatcher(MasterMotionManager *masterMotionManager);

    void setContextProperty(QQmlApplicationEngine &engine);

    // Dispatcher interface
protected:
    virtual void handleInit() override;
    virtual void handleStart() override;
    virtual void handlePause() override;
    virtual void handleContinue() override;
    virtual void handleAbort() override;
    virtual void handleReset() override;
    virtual void preHome() override;
    virtual void postHome() override {}

private:
    UPHHelper *uphHelper;

    MasterMotionManager *masterMotionManager;

    AACore *aaCore;
    AAImage *aaImage;

    PickArm *pickArm;
    AaHead *aaHead;

    TrayConfig *lensTrayConfig;
    ConfigFile *lensTrayConfigFile;
    LensTrayMap *lensTrayMap;

    TrayConfig *sensorTrayConfig;
    ConfigFile *sensorTrayConfigFile;
    SensorTrayMap *sensorTrayMap;

    TrayConfig *rejectTrayConfig;
    ConfigFile *rejectTrayConfigFile;
    SensorTrayMap *rejectTrayMap;

    PressureMonitor* pressureMonitor;
};

#endif // SCAADISPATCHER_H
